package cn.xopencode.recordservice.provider.drytransformer;

import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.manager.drytransformer.DryTransformerRecordManager;
import cn.xopencode.recordservice.rpc.drytransformer.DryTransformerRecordRpc;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordCreateDTO;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordPageDTO;
import cn.xopencode.recordservice.rpc.drytransformer.dto.DryTransformerRecordUpdateDTO;
import cn.xopencode.recordservice.rpc.drytransformer.vo.DryTransformerRecordAdminPageVO;
import cn.xopencode.recordservice.rpc.drytransformer.vo.DryTransformerRecordPageVO;
import cn.xopencode.recordservice.rpc.drytransformer.vo.DryTransformerRecordUpdateVO;
import cn.xopencode.recordservice.rpc.robotroom.dto.AdminRecordPageDTO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;


@DubboService(version = "${dubbo.provider.DryTransformerRecordRpc.version}")
public class DryTransformerRecordRpcImpl implements DryTransformerRecordRpc {

    @Autowired
    private DryTransformerRecordManager dryTransformerRecordManager;

    @Override
    public CommonResult<Integer> createDryTransformerRecord(DryTransformerRecordCreateDTO createDTO) {
        Integer result = dryTransformerRecordManager.createDryTransformerRecord(createDTO);
        return CommonResult.success(result);
    }

    @Override
    public CommonResult<PageResult<DryTransformerRecordPageVO>> pageDryTransformerRecord(DryTransformerRecordPageDTO pageDTO) {
        return CommonResult.success(dryTransformerRecordManager.pageDryTransformerRecord(pageDTO));
    }

    @Override
    public CommonResult<DryTransformerRecordUpdateVO> getDryTransformerRecordById(String id) {
        return CommonResult.success(dryTransformerRecordManager.getDryTransformerRecordById(id));
    }

    @Override
    public CommonResult<Integer> updateDryTransformerRecord(DryTransformerRecordUpdateDTO updateDTO) {
        Integer result = dryTransformerRecordManager.updateDryTransformerRecord(updateDTO);
        return CommonResult.success(result);
    }

    @Override
    public CommonResult<Integer> dealDryTranformerRecordException(String recordId) {
        return CommonResult.success(dryTransformerRecordManager.dealDryTranformerRecordException(recordId));
    }

    @Override
    public CommonResult<PageResult<DryTransformerRecordAdminPageVO>> getAdminPageDryTranformerRecord(AdminRecordPageDTO pageDTO) {
        return CommonResult.success(dryTransformerRecordManager.getAdminPageDryTranformerRecord(pageDTO));
    }
}
